#include<bits/stdc++.h>
using namespace std;
const int N=1e5+9;
int n,num,max_cnt,h=100,l=100;
int dx[4]={-1,0,1,0};
int dy[4]={0,-1,0,1};
string s;
int opss[N],ops[N],op[N],len;
char col[109][109];
void dfs(int nx,int ny,int gx,int gy,int cnt,int now){
	if(nx==gx&&ny==gy){
		if(cnt>num){
			for(int i=0;i<cnt;i++) ops[i]=op[i];
			num=cnt;
		}
		return;
	}
	if(max_cnt-cnt<abs(nx-gx)+abs(ny-gy)) return;
	for(int i=0;i<4;i++){
		int xx=nx+dx[i],yy=ny+dy[i];
		if(xx<1||xx>h||yy<1||yy>l) continue;
		if(!(xx==gx&&yy==gy)&&col[xx][yy]=='\0') continue;
		if(!(xx==gx&&yy==gy)&&col[xx][yy]!=s[now]) continue;
		op[cnt]=i;
		dfs(xx,yy,gx,gy,cnt+1,now+1);
	}
}
char dir(int x){
	if(x==0) return 'U';
	if(x==1) return 'L';
	if(x==2) return 'D';
	return 'R';
}
int main(){
	freopen("snake.in","r",stdin);
	freopen("snake.out","w",stdout);
	cin>>s;
	n=s.size();
	cout<<h<<' '<<l<<'\n';
	int x=1,y=1,now=0;col[1][1]=s[0];
	int z=0; 
	while(now!=n-1){
		z++;
		num=0;
		int xx,yy;
		if((x&1)&&yy!=l) xx=x,yy=y+1;
		else if(!(x&1)&&yy!=1) xx=x,yy=y-1;
		else xx=x+1,yy=y;
		max_cnt=min(30,n-1-now);
		dfs(x,y,xx,yy,0,now+1);
		now+=num;
		col[xx][yy]=s[now];
		for(int i=0;i<num;i++) opss[++len]=ops[i];
		x=xx;y=yy;
	}
	for(int i=1;i<=h;i++){
		for(int j=1;j<=l;j++){
			if(col[i][j]=='\0') cout<<'R';
			else cout<<col[i][j];
		}
		cout<<'\n';
	}
	cout<<1<<' '<<1<<'\n';
	for(int i=1;i<=len;i++) cout<<dir(opss[i]);
	cout<<'\n';
	return 0;
}
